class Solution {
public:
    bool isAnagram(string s, string t) {
        int st[30] = { 0 };
        for (auto x : s) {
            st[x - 'a' + 1]++;
        }
        for (auto x : t) {
            st[x - 'a' + 1]--;
        }
        for (int i = 1; i <= 26; i++) {
            if (st[i] != 0)return 0;
        }
        return 1;
    }
};